package com.bwda.dsrs.filecenter.ftpsdk;


import com.bwda.dsrs.filecenter.ftpsdk.impl.FtpServcieImpl;
import com.bwda.dsrs.filecenter.ftpsdk.impl.SftpServiceImpl;
import org.apache.commons.net.ftp.FTP;

/**
 * @description:
 * @author: yangjun
 * @create: 2019-07-16 15:59
 */
public class FtpFactory {
    private FtpFactory() {
    }

    public static FtpService getFtpService(EnFtpType ftpType) {
        FtpService fs = null;
        switch (ftpType) {
            case FTP:
                fs = FtpServcieImpl.getInstance();
                break;
            case SFTP:
                fs = SftpServiceImpl.getInstance();
                break;
                default:break;
        }

        return (FtpService) fs;
    }

    public enum EnFtpType {
        /**
         * FTP
         */
        FTP,
        /**
         * SFTP
         */
        SFTP;

         EnFtpType() {
        }
    }
}